package packing;

public class Box extends BoxShape {
	
	String id;
	BlockRelation relation;
	Box nextNode ;
	
	public Box getNextNode() {
		return nextNode;
	}

	public void setNextNode(Box nextNode) {
		this.nextNode = nextNode;
	}

	public BlockRelation getRelation() {
		return relation;
	}

	public void setRelation(BlockRelation relation) {
		this.relation = relation;
	}

	public String getId() {
		if(relation == null)	return id;
		else 	return id + "-" + relation + "("+nextNode.getId()+")";
	}
	
	public String getOriginalId(){
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Box(String id, int width, int length, int height) {		
		super(width, length, height);
		this.id = id;
	}
	
	public Box(String id, int width, int length, int height, BlockRelation relation, Box b) {		
		super(width, length, height);
		this.id = id;
		this.relation = relation;
		this.nextNode = b;
	}
	
	public Box() {	}

	@Override
	public String toString() {
		return "BoxPack : id=" + id + ", ความกว้าง =" + width + ", ความยาว =" + length
				+ ", ความสูง =" + height + "\n";
	}
}
